home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / protocols / routed.m next >
Encoding:
Text File  |  2002-10-28  |  4.2 KB  |  104 lines

  1. /*-
  2.  * Copyright (c) 1983, 1989 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *      This product includes software developed by the University of
  16.  *      California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *      @(#)routed.h    5.3 (Berkeley) 4/3/91
  34.  */
  35.  
  36. /*
  37.  * Routing Information Protocol
  38.  *
  39.  * Derived from Xerox NS Routing Information Protocol
  40.  * by changing 32-bit net numbers to sockaddr's and
  41.  * padding stuff to 32-bit boundaries.
  42.  */
  43. #define RIPVERSION      1
  44.  
  45. OBJECT netinfo
  46.     rip_dst:sockaddr,       /* destination net/host */
  47.     rip_metric:LONG             /* cost of route */
  48.  
  49.  
  50. OBJECT rip
  51.     rip_cmd:UBYTE,                /* request/response */
  52.     rip_vers:UBYTE,               /* protocol version # */
  53.     rip_res1[2]:UBYTE,            /* pad to 32-bit boundary */
  54.     [CUNION
  55.         ru_nets[1]:netinfo,     /* variable length... */
  56.         ru_tracefile[1]:BYTE        /* ditto ... */
  57.     ENDUNION]:ripun
  58.  
  59. #define rip_nets        ripun.ru_nets
  60. #define rip_tracefile   ripun.ru_tracefile
  61.  
  62.  
  63. /*
  64.  * Packet types.
  65.  */
  66. #define RIPCMD_REQUEST          1       /* want info */
  67. #define RIPCMD_RESPONSE         2       /* responding to request */
  68. #define RIPCMD_TRACEON          3       /* turn tracing on */
  69. #define RIPCMD_TRACEOFF         4       /* turn it off */
  70.  
  71. #define RIPCMD_MAX              5
  72. /*
  73. #ifdef RIPCMDS
  74. char *ripcmds[RIPCMD_MAX] =
  75.   { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
  76. #endif
  77. */
  78. #define HOPCNT_INFINITY         16      /* per Xerox NS */
  79. #define MAXPACKETSIZE           512     /* max broadcast size */
  80.  
  81. /*
  82.  * Timer values used in managing the routing table.
  83.  * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
  84.  * If changes occur between updates, dynamic updates containing only changes
  85.  * may be sent.  When these are sent, a timer is set for a random value
  86.  * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
  87.  * are sent until the timer expires.
  88.  *
  89.  * Every update of a routing entry forces an entry's timer to be reset.
  90.  * After EXPIRE_TIME without updates, the entry is marked invalid,
  91.  * but held onto until GARBAGE_TIME so that others may
  92.  * see it "be deleted".
  93.  */
  94. #define TIMER_RATE              30      /* alarm clocks every 30 seconds */
  95.  
  96. #define SUPPLY_INTERVAL         30      /* time to supply tables */
  97. #define MIN_WAITTIME            2       /* min. interval to broadcast changes */
  98. #define MAX_WAITTIME            5       /* max. time to delay changes */
  99.  
  100. #define EXPIRE_TIME             180     /* time to mark entry invalid */
  101. #define GARBAGE_TIME            240     /* time to garbage collect */
  102.  
  103. #endif /* !_ROUTED_H_ */
  104.